<script setup>
import { defineProps } from 'vue'

defineProps({
  postsData: {
    type: Object
  }
})
</script>

<template>
  <div class="box-aa">
    <div class="top">
      <div>
        <div style="display: flex">
          <div
            style="
              display: inline-block;
              max-widths: 200px;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            "
            class="name"
          >
            {{ postsData.name }}
          </div>
          <div class="name" style="margin-left: 10px">
            [{{ postsData.city }}]
          </div>
        </div>
        <div style="display: flex; margin-top: 10px">
          <div style="color: red">{{ postsData.salary }}</div>
          <div>
            <el-tag class="ml-2" type="info" style="margin-left: 10px"
              >工作经验：{{ postsData.workExperience }}</el-tag
            >
          </div>
          <div>
            <el-tag
              v-if="postsData.academicQualifications === 0"
              class="ml-2"
              type="info"
              style="margin-left: 10px"
              >无学历要求</el-tag
            >
            <el-tag
              v-if="postsData.academicQualifications === 1"
              class="ml-2"
              type="info"
              style="margin-left: 10px"
              >高中</el-tag
            >
            <el-tag
              v-if="postsData.academicQualifications === 2"
              class="ml-2"
              type="info"
              style="margin-left: 10px"
              >大专</el-tag
            >
            <el-tag
              v-if="postsData.academicQualifications === 3"
              class="ml-2"
              type="info"
              style="margin-left: 10px"
              >本科</el-tag
            >
            <el-tag
              v-if="postsData.academicQualifications === 4"
              class="ml-2"
              type="info"
              style="margin-left: 10px"
              >研究生</el-tag
            >
            <el-tag
              v-if="postsData.academicQualifications === 5"
              class="ml-2"
              type="info"
              style="margin-left: 10px"
              >博士</el-tag
            >
          </div>
        </div>
      </div>
    </div>
    <div class="buttom">
      <div>
        <el-tag
          v-for="(item, index) in postsData.postsKey
            .replace(/^\W+|\W+$/g, '')
            .split(',')"
          :key="index"
          size="small"
          class="ml-2"
          type="info"
          style="margin-left: 10px"
          >{{ item }}</el-tag
        >
      </div>
      <div
        style="
          color: #999;
          width: 300px;
          margin-left: 220px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        "
      >
        <span>{{ postsData.welfare.replace(/^\W+|\W+$/g, '') }}</span>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.box-aa {
  height: 130px;
  border-radius: 18px;
  background-color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  transition: box-shadow 0.5s ease; /* 过渡效果 */
  cursor: pointer;
  .top {
    height: 50%;
    font-size: 16px;
    margin-left: 30px;
    margin-top: 20px;
    display: flex;
    .name {
      transition: color 0.5s ease; /* 过渡效果 */
    }
    .message {
      width: 75px;
      height: 22px;
      border-radius: 5px;
      background-color: #00bebd;
      margin-left: 5px;
      color: #fff;
      font-size: 12px;
      line-height: 22px;
      text-align: right;
      padding-right: 7px;
      margin-top: 2px;
      display: flex;
    }
  }
  .buttom {
    width: 100%;
    height: 32%;
    background: linear-gradient(to right, #f5fcfc, #fcfbfa);
    padding-top: 10px;
    padding-left: 15px;
    position: relative;
    display: flex;
  }
}
.box-aa:hover {
  box-shadow: 0px 10px 30px #ddd;
  .name {
    color: #00bebd;
  }
}
</style>
